/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.contact.teacher.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.zx.contact.teacher.entity.TcontactTeacher;
import com.jeesite.modules.zx.contact.teacher.dao.TcontactTeacherDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 联系老师Service
 * @author zpp
 * @version 2020-02-20
 */
@Service
@Transactional(readOnly=true)
public class TcontactTeacherService extends CrudService<TcontactTeacherDao, TcontactTeacher> {
	
	/**
	 * 获取单条数据
	 * @param tcontactTeacher
	 * @return
	 */
	@Override
	public TcontactTeacher get(TcontactTeacher tcontactTeacher) {
		return super.get(tcontactTeacher);
	}
	
	/**
	 * 查询分页数据
	 * @param tcontactTeacher 查询条件
	 * @param tcontactTeacher.page 分页对象
	 * @return
	 */
	@Override
	public Page<TcontactTeacher> findPage(TcontactTeacher tcontactTeacher) {
		return super.findPage(tcontactTeacher);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param tcontactTeacher
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(TcontactTeacher tcontactTeacher) {
		super.save(tcontactTeacher);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(tcontactTeacher.getId(), "tcontactTeacher_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(tcontactTeacher.getId(), "tcontactTeacher_file");
	}
	
	/**
	 * 更新状态
	 * @param tcontactTeacher
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(TcontactTeacher tcontactTeacher) {
		super.updateStatus(tcontactTeacher);
	}
	
	/**
	 * 删除数据
	 * @param tcontactTeacher
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(TcontactTeacher tcontactTeacher) {
		super.delete(tcontactTeacher);
	}
	
}